package cn.kgc.mybatis.mapper;

import cn.kgc.mybatis.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author: mosin
 * @version: v1.0  2022/4/20
 * 注解开发
 */
public interface UserMapper2 {

    // @Select("select *  from user where id = #{id}")
     User  selectById(int id);
     @Select("select *  from user ")
     List<User>  selectAll();
     @Insert("insert  into user (user_name,password)values(#{userName},#{password})")
     int addUser(User user);
     @Update("update user set password = #{password} where id = #{id}")
     int updateUser(User user);
     @Delete("delete from user  where id = #{id}")
     int delUser(int id);
}
